 <template><Card style="height: 800px;">
      <Tree :data="data1" :load-data="loadDatatree" @on-select-change="selectOne"></Tree>
    </Card>
    </template>
    <script>
    export default {
  data() {
    // 快递状态
    return {
      data1: [],
    }
    },
    created: function() {
    this.postRequest("/api/user/treeListById").then(res => {
      console.log(res);
      if (res.code == 20000) {
        this.data1 = res.data;
      } else {
        this.$Message.error({
          content: res.message,
          duration: 5
        });
      }
    });
    },
       loadDatatree(item, callback) {
      if (item.children.length == 0) {
        this.getRequest("/api/user/treeListById?parentId=" + item.id).then(res => {
          if (res.code == 20000) {
            if (!res.data.isLeaf) {
              const data = res.data;
              callback(data);
            } else {
              //const data = res.data
            }
          } else {
            this.$Message.error({
              content: res.message,
              duration: 5
            });
          }
        });
      }
    },selectOne() {},
    }
    </script>

